package ace.module.oauth2.server.api.model.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import jakarta.validation.constraints.*;
import jakarta.annotation.Nullable;
import java.io.Serializable;

/**
* oauth2客户端支持的认证与授权协议配置,支持本地bean与rest方式 data transform object.
*
* @author Caspar
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = Oauth2RegisteredClientAuthConfigDto.TABLE_DESC)
public class Oauth2RegisteredClientAuthConfigDto implements Serializable {

  public static final String TABLE_NAME = "oauth2_registered_client_auth_config";
  public static final String TABLE_DESC = "oauth2客户端支持的认证与授权协议配置,支持本地bean与rest方式";
  public static final String ID_COLUMN_NAME = "id";
  public static final String ID_TITLE = "id";
  public static final String ID_DESC = "";
  public static final String ID_OF_CLIENT_COLUMN_NAME = "id_of_client";
  public static final String ID_OF_CLIENT_TITLE = "客户端id";
  public static final String ID_OF_CLIENT_DESC = "";
  public static final String BIZ_AUTH_TYPE_COLUMN_NAME = "biz_auth_type";
  public static final String BIZ_AUTH_TYPE_TITLE = "认证或授权类型";
  public static final String BIZ_AUTH_TYPE_DESC = " 1-未知 2-认证 3-授权";
  public static final String API_IMPL_TYPE_COLUMN_NAME = "api_impl_type";
  public static final String API_IMPL_TYPE_TITLE = "接口实现方式类型";
  public static final String API_IMPL_TYPE_DESC = " bean-bean方式 rest-rest方式";
  public static final String BEAN_NAME_COLUMN_NAME = "bean_name";
  public static final String BEAN_NAME_TITLE = "bean name";
  public static final String BEAN_NAME_DESC = "接口bean实现方式的bean name";
  public static final String AUTHENTICATION_TYPE_COLUMN_NAME = "authentication_type";
  public static final String AUTHENTICATION_TYPE_TITLE = "客户端认证方式";
  public static final String AUTHENTICATION_TYPE_DESC = "支持自定义 unknown-未知 default-默认 username-账户名与密码 phone-手机验证码 wx_mini_app_login_code-微信小程序登录code wx_mini_app_phone_code-微信小程序手机号登录 client_credentials-客户端认证";
  public static final String FEIGN_NAME_COLUMN_NAME = "feign_name";
  public static final String FEIGN_NAME_TITLE = "feign name";
  public static final String FEIGN_NAME_DESC = "接口feign实现方式的feign name";
  public static final String FEIGN_REQUEST_INTERCEPTOR_STATUS_COLUMN_NAME = "feign_request_interceptor_status";
  public static final String FEIGN_REQUEST_INTERCEPTOR_STATUS_TITLE = "feign请求拦截器";
  public static final String FEIGN_REQUEST_INTERCEPTOR_STATUS_DESC = " 1-未知 2-none 3-内部服务";
  public static final String CALLBACK_URL_COLUMN_NAME = "callback_url";
  public static final String CALLBACK_URL_TITLE = "客户端feign接口调用地址";
  public static final String CALLBACK_URL_DESC = "";
  public static final String PRIORITY_COLUMN_NAME = "priority";
  public static final String PRIORITY_TITLE = "优先级";
  public static final String PRIORITY_DESC = "";
  public static final String STATUS_COLUMN_NAME = "status";
  public static final String STATUS_TITLE = "状态";
  public static final String STATUS_DESC = " 1-启用 2-禁用";
  public static final String NAME_COLUMN_NAME = "name";
  public static final String NAME_TITLE = "名称";
  public static final String NAME_DESC = "";
  public static final String REMARK_COLUMN_NAME = "remark";
  public static final String REMARK_TITLE = "备注";
  public static final String REMARK_DESC = "";
  public static final String DELETE_FLAG_COLUMN_NAME = "delete_flag";
  public static final String DELETE_FLAG_TITLE = "删除标识";
  public static final String DELETE_FLAG_DESC = "0-未删除";
  public static final String CREATE_TIME_COLUMN_NAME = "create_time";
  public static final String CREATE_TIME_TITLE = "创建时间";
  public static final String CREATE_TIME_DESC = "单位-毫秒";
  public static final String UPDATE_TIME_COLUMN_NAME = "update_time";
  public static final String UPDATE_TIME_TITLE = "更新时间";
  public static final String UPDATE_TIME_DESC = "单位-毫秒";
  public static final String ROW_VERSION_COLUMN_NAME = "row_version";
  public static final String ROW_VERSION_TITLE = "版本号和乐观锁";
  public static final String ROW_VERSION_DESC = "";

  @Schema(title = ID_TITLE, description = ID_DESC)
  private Long id;

  @Size(max = 255)
  @Schema(title = ID_OF_CLIENT_TITLE, description = ID_OF_CLIENT_DESC)
  private String idOfClient;

  @Schema(title = BIZ_AUTH_TYPE_TITLE, description = BIZ_AUTH_TYPE_DESC)
  private Integer bizAuthType;

  @Size(max = 255)
  @Schema(title = API_IMPL_TYPE_TITLE, description = API_IMPL_TYPE_DESC)
  private String apiImplType;

  @Size(max = 255)
  @Schema(title = BEAN_NAME_TITLE, description = BEAN_NAME_DESC)
  private String beanName;

  @Size(max = 255)
  @Schema(title = AUTHENTICATION_TYPE_TITLE, description = AUTHENTICATION_TYPE_DESC)
  private String authenticationType;

  @Size(max = 255)
  @Schema(title = FEIGN_NAME_TITLE, description = FEIGN_NAME_DESC)
  private String feignName;

  @Schema(title = FEIGN_REQUEST_INTERCEPTOR_STATUS_TITLE, description = FEIGN_REQUEST_INTERCEPTOR_STATUS_DESC)
  private Integer feignRequestInterceptorStatus;

  @Schema(title = CALLBACK_URL_TITLE, description = CALLBACK_URL_DESC)
  private String callbackUrl;

  @Schema(title = PRIORITY_TITLE, description = PRIORITY_DESC)
  private Long priority;

  @Schema(title = STATUS_TITLE, description = STATUS_DESC)
  private Integer status;

  @Size(max = 255)
  @Schema(title = NAME_TITLE, description = NAME_DESC)
  private String name;

  @Size(max = 255)
  @Schema(title = REMARK_TITLE, description = REMARK_DESC)
  private String remark;

  @Schema(title = DELETE_FLAG_TITLE, description = DELETE_FLAG_DESC)
  private Long deleteFlag;

  @Schema(title = CREATE_TIME_TITLE, description = CREATE_TIME_DESC)
  private Long createTime;

  @Schema(title = UPDATE_TIME_TITLE, description = UPDATE_TIME_DESC)
  private Long updateTime;

  @Schema(title = ROW_VERSION_TITLE, description = ROW_VERSION_DESC)
  private Long rowVersion;

}